-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: vm rpc encoding #8288
fix: vm rpc encoding #8288
Conversation
yeah, I think people might already rely on |
right, the issue in #8287 is for fixed bytes (eth_getStorageAt), I changed the fix and mapped those to |
crates/cheatcodes/src/evm/fork.rs
Outdated
{ | ||
DynSolValue::FixedBytes(bytes, _) => { | ||
// converted fixed bytes to bytes to prevent evm encoding issues: <https://github.com/foundry-rs/foundry/issues/8287> | ||
DynSolValue::Bytes(bytes.to_vec()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be vec![_; 32] for bytes31, bytes30 ... is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bytes.as_slice()[..size].to_vec()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
Does the same apply to Address? |
maybe, but I'm not aware of any rpc call that returns an address, but I've added it |
closes #8287
@DaniPopes @klkvr I'm not sure what the appropriate behaviour here would be, but I think ensuring the cheatcode returns the abiencoded rpc response as abi bytes makes sense, but maybe we don't double encode if the
DynSolValue
is alreadyBytes
?I guess this breaks existing tests, maybe this should really just convert dynsolvariants that don't encode to bytes?